jQuery(document).ready(function() {
	initTable();
});

function initTable(){
	$('#detail').bootstrapTable({
		method: 'post',
	    url: basePath() + 'supervise/complaintByParam.do',
	    pagination: true, //分页
	    dataType: "json",
        contentType: "application/json",
        pageList: [10, 20, 50, 100],  //可供选择的每页的行数（*）
        striped: true,      //是否显示行间隔色
        sidePagination: "server",
        showHeader:true,
        queryParams:function(params) {
        	var param ={};
        	param.pageNum =  params.offset / params.limit + 1;
        	param.pageSize = params.limit;
        	param.itemno = getUrlParam("itemno");
        	if(1==getUrlParam("flag")){
        		param.serviceattitude =  getUrlParam("param");
        	}else{
        		param.handlespeed =  getUrlParam("param");
        	}
            return param;
        },
	    columns: [{
            field : 'number',  
            title : '序号',  
            align : 'center',
            width : '50px',
            formatter : function(value, row, index) {  
                var page = $('#detail').bootstrapTable("getPage");  
                return page.pageSize * (page.pageNumber - 1) + index + 1;  
            }  
        }, {
	        field: 'applyno',
	        title: '申请单号' 
	    }, {
	        field: 'itemname',
	        title: '项目名称' 
	    }, {
	        field: 'itemtypecode',
	        title: '项目类型',
	        formatter:function(value,row,index){
	        	return row.itemtypecode+"-"+row.itemtypecodename;
	        }
	    }, {
	        field: 'applytime',
	        title: '申请时间' 
	    }, {
	        field: 'orgname',
	        title: '受理机构' 
	    }, {
	        field: 'serviceattitude',
	        title: '服务态度',
	        formatter:function(value,row,index){
	        	return '<input   name="serviceStar" type="number" class="rating"   value="'+value+'"   >';
	        }
	    }, {
	        field: 'handlespeed',
	        title: '办理进度' ,
	        formatter:function(value,row,index){
	        	return '<input type="number" name="handleStar"   class="rating"   value="'+value+'" >';
	        }
	    }],
	    onLoadSuccess:function(){
	    	$('input[name="serviceStar"],input[name="handleStar"]').rating('refresh',{
				language:'zh',
				theme:'krajee-uni',
				min:0,
				max:5,
				step: 1, 
				showClear:false,
				showCaption:false,
				hoverOnClear:false,
				size:'xs',
				readonly:true
			});
	    }
	});
	 
}
 